var t = getApp();

Page({
    data: {
        pageindx: 0
    },
    onLoad: function(t) {
        this.getData();
    },
    chooseTabData: function(t) {
        if (this.setData({
            pageindx: t.detail.index
        }), this.data.pageindx > 0) {
            var e = this.data.info.levels[t.detail.index - 1].id;
            this.getList(e);
        }
    },
    gojilu: function() {
        wx.navigateTo({
            url: "/packageE/team_sell/activeRecord/activeRecord"
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    getData: function() {
        var e = this, a = t.getNetAddresss("plugin.team-sales.api.active.index");
        t._postNetWork({
            url: a,
            success: function(t) {
                var a = t.data;
                1 == a.result ? (console.log(a), e.setData({
                    info: a.data
                })) : wx.showToast({
                    title: a.msg,
                    icon: "none"
                });
            },
            fail: function(t) {
                wx.showToast({
                    title: t.msg,
                    icon: "none"
                });
            }
        });
    },
    getList: function(e) {
        var a = this, n = t.getNetAddresss("plugin.team-sales.api.active.level");
        t._postNetWork({
            url: n,
            data: {
                level_id: e
            },
            success: function(t) {
                var e = t.data;
                1 == e.result ? (console.log(e), a.setData({
                    list: e.data.member.data
                })) : wx.showToast({
                    title: e.msg,
                    icon: "none"
                });
            },
            fail: function(t) {
                wx.showToast({
                    title: t.msg,
                    icon: "none"
                });
            }
        });
    }
});